﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ProfileProperty.cs" company="ScRePt">
//   Copyright © ScRePt 2010 - 2012
// </copyright>
// <summary>
//   The profile property.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace MP3D.Configuration
{
    #region Using Directives

    using System;
    using System.Xml.Serialization;

    #endregion

    /// <summary>
    /// The profile property.
    /// </summary>
    [Serializable]
    [XmlInclude(typeof(ProfilePropertyPerMediaType))]
    [XmlInclude(typeof(ProfilePropertyPerSource))]
    public class ProfileProperty
    {
        #region Enums

        /// <summary>
        /// The profile property type.
        /// </summary>
        public enum ProfilePropertyType
        {
            /// <summary>
            /// The save globally.
            /// </summary>
            SaveGlobally = 1, 

            /// <summary>
            /// The save per media type.
            /// </summary>
            SavePerMediaType = 2, 

            /// <summary>
            /// The save per source.
            /// </summary>
            SavePerSource = 3
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets DefaultValue.
        /// </summary>
        [XmlAttribute]
        public int DefaultValue { get; set; }

        /// <summary>
        /// Gets or sets PropertyId.
        /// </summary>
        [XmlAttribute]
        public int PropertyId { get; set; }

        /// <summary>
        /// Gets or sets PropertyType.
        /// </summary>
        [XmlAttribute]
        public ProfilePropertyType PropertyType { get; set; }

        #endregion

        #region Public Methods

        /// <summary>
        /// The clone to.
        /// </summary>
        /// <param name="cloneTo">
        /// The clone to.
        /// </param>
        public void CloneTo(ProfileProperty cloneTo)
        {
            cloneTo.DefaultValue = this.DefaultValue;
            cloneTo.PropertyId = this.PropertyId;
            cloneTo.PropertyType = this.PropertyType;
        }

        #endregion
    }
}